<?php
/**
 * Created by PhpStorm.
 * User: rongxiang
 * Date: 16/6/6
 * Time: 上午10:49
 */
class AdminLogm extends CI_Model
{
    function __construct()
    {
        $this->config = array();
        $CI =& get_instance();

        if ($CI->config->load('adminlog', TRUE, TRUE))
        {
            $this->config = $CI->config->item('adminlog');
        }
    }
    #记录
    //
    public function insert_admin_log($post_id,$type,$user_id, $platform = 2)
    {
        $data = array();
        $this->load->model('userm');
        $userinfo = $this->userm->getUserInfo($user_id);
        $data['user_id']  = $user_id;
        $data['content']  = $this->config[$type]['content'];
        $data['post_id']  = $post_id;
        $data['platform'] = $platform;
        $data['type']     = $type;
        $data['addtime']  = time();
        $data['username'] = $userinfo['username'];
        return $this->db->insert('op_admin_log',$data);
    }

}